package appapi.entity.Zhongjiao;

import appapi.entity.bridge.SceneEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author dhq
 * @date 2023/9/11  12:26
 * @version 1.0
 */

/**
    * 场景管理
    */
@ApiModel(description="场景管理")
@Data
public class SceneDto implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @ApiModelProperty(value="ID")
    private Long sceneId;

    /**
     * 场景编号
     */
    @ApiModelProperty(value="场景编号")
    @TableField(value = "sceneNo")
    private String sceneNo;

    /**
    * 场景名称
    */
    @ApiModelProperty(value="场景名称")
    private String sceneName;

    /**
    * 场景类别
    */
    @ApiModelProperty(value="场景类别:桥墩，桥面")
    private String sceneType;

    /**
     * 设备数量
     */
    @ApiModelProperty(value="设备数量")
    @TableField(value = "scene_count")
    private Integer sceneCount;

    /**
    * 所属项目
    */
    @ApiModelProperty(value="所属项目")
    private Long projId;



    /**
    * 场景摘要
    */
    @ApiModelProperty(value="场景摘要")
    private String sceneSummary;


    /**
     * 开始时间
     */
    @ApiModelProperty(value="开始时间")
    @TableField(value = "scene_start")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sceneStart;

    @ApiModelProperty(value="场景设备列表")
    private List<SceneEquipmentDto> list;

    public SceneEntity Entity(){
        SceneEntity entity = new SceneEntity();
        BeanUtils.copyProperties(this,entity);
        return entity;
    }
}